﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;

namespace Red.Launcher.Menus.Workspaces.Admin
{
    public static class AdminDialogCommands
    {
        #region Commands

        public static ICommand Ok { get; private set; } = new RoutedCommand( "Ok", typeof( AdminDialogStructure ) );
        public static ICommand Cancel { get; private set; } = new RoutedCommand( "Cancel", typeof( AdminDialogStructure ) );

        #endregion Commands
    }

    [ContentProperty( "MainContent" )]
    public class AdminDialogStructure : ContentControl
    {
        #region Dependency Properties

        public static readonly DependencyProperty NavigationWidthProperty = DependencyProperty.Register( "NavigationWidth", typeof( GridLength ), typeof( AdminDialogStructure ), new PropertyMetadata( new GridLength( 250.0 ) ) );
        public static readonly DependencyProperty NavigationProperty = DependencyProperty.Register( "Navigation", typeof( object ), typeof( AdminDialogStructure ) );
        public static readonly DependencyProperty MainContentProperty = DependencyProperty.Register( "MainContent", typeof( object ), typeof( AdminDialogStructure ) );
        public static readonly DependencyProperty ButtonsProperty = DependencyProperty.Register( "Buttons", typeof( object ), typeof( AdminDialogStructure ) );
        public static readonly DependencyProperty IsOkEnabledProperty = DependencyProperty.Register( "IsOkEnabled", typeof( bool ), typeof( AdminDialogStructure ) );

        #endregion Dependency Properties

        #region Public Properties

        public GridLength NavigationWidth
        {
            get { return (GridLength)GetValue( NavigationWidthProperty ); }
            set { SetValue( NavigationWidthProperty, value ); }
        }

        public object Navigation
        {
            get { return (object)GetValue( NavigationProperty ); }
            set { SetValue( NavigationProperty, value ); }
        }

        public object MainContent
        {
            get { return (object)GetValue( MainContentProperty ); }
            set { SetValue( MainContentProperty, value ); }
        }

        public object Buttons
        {
            get { return (object)GetValue( ButtonsProperty ); }
            set { SetValue( ButtonsProperty, value ); }
        }

        public bool IsOkEnabled
        {
            get { return (bool)GetValue( IsOkEnabledProperty ); }
            set { SetValue( IsOkEnabledProperty, value ); }
        }

        #endregion Public Properties

        #region C-Tor

        public AdminDialogStructure()
        {
        }

        #endregion C-Tor
    }
}
